package com.csw.android.dev_utils.log.request

import androidx.lifecycle.MutableLiveData
import com.csw.android.dev_utils.log.LogInfo

/**
 * 请求的Log 信息
 */
class RequestLogInfo(level: Int, time: Long, tag: String, msg: String) :
    LogInfo(level, time, tag, msg) {

    val level1 = MutableLiveData(level)

    /**
     * 请求头
     */
    val requestHeader = MutableLiveData<String?>()

    /**
     * 请求
     */
    val request = MutableLiveData<String?>()

    /**
     * 响应
     */
    val response = MutableLiveData<String?>()

    override fun toString(): String {
        return """
${getContent()}

${requestHeader.value}

${request.value}

${response.value}
        """.trimIndent().trimMargin()
    }
}